package com.xdemo.personal.server.pool;

import java.util.EnumMap;
import java.util.Map;

import com.xdemo.processor.IProcessor;

/**
 * @author qianwp
 *
 */
public class ProcessorPool {
	
	private final static Map<EProcessor,IProcessor<?>> processors = new EnumMap<EProcessor,IProcessor<?>>(EProcessor.class);
	
	public static void register(EProcessor name,IProcessor<?> processor) {
		processors.put(name, processor);
	}
	
	public static IProcessor<?> getProcessor(EProcessor name) {
		return processors.get(name);
	}
	
}
